
import java.util.ArrayList;

public class ListErr {
    public static void main(String[] args) {
        ArrayList strList = new ArrayList();
        strList.add("Java从入门到精通");
        strList.add("数据结构与算法");
        strList.add(5);
        strList.forEach(str -> System.out.println(((String)str).length()));
    }
}
